package com.demo.job;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.demo.helloworld.logic.SayHelloLogic;
import com.outstanding.framework.core.PendingException;
import com.outstanding.framework.plugin.elasticjob.OutstandingJob;


@Component(value = "DemoJob")
public class DemoJob extends OutstandingJob {
	
	
	@Autowired
	private SayHelloLogic logic;

	@Override
	protected void doSimpleJob(ShardingContext shardingContext) throws PendingException {
		System.out.println(shardingContext.getJobName());
		System.out.println("分片总数:"+shardingContext.getShardingTotalCount());
		System.out.println(shardingContext.getTaskId());
		System.out.println(shardingContext.getShardingItem());
		logic.say();
	}
	
}
